<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
<head>
    <title></title>
    <meta charset="utf-8">
    <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" href="jgp/css/project/ui-color-v3.css">
    <link rel="stylesheet" href="jgp/css/project/ui-list-v3.css">
    <link rel="stylesheet" href="jgp/css/project/ui-input-v3.css">
    <link rel="stylesheet" href="jgp/css/project/ui-btn-v3.css">
    <link rel="stylesheet" href="jgp/css/project/ui-res-v3.css">
    <link rel="stylesheet" href="jgp/css/ui-color.css">
    <link rel="stylesheet" href="jgp/css/ui-res.css">
    <link rel="stylesheet" href="jgp/css/ui-input.css">
    <link rel="stylesheet" href="jgp/css/ui-base.css">
    <link rel="stylesheet" href="jgp/css/ui-box.css">
    <link rel="stylesheet" href="jgp/css/project/style.css">
	<link rel="stylesheet" href="jgp/css/my.css">
	<link rel="stylesheet" href="jgp/css/iBox.css">
	
	<script src="jgp/js/zy_control.js"></script>
	<script src="jgp/js/zy_tmpl.js"></script>
    <script src="jgp/js/zy_click.js"></script>
    <script src="jgp/js/common.js"></script>
    <script src="jgp/js/zy_json.js"></script>
    <script src="jgp/js/zy_event.js"></script>
	<script src="jgp/js/recyclelist.js"></script>
	<script src="jgp/js/jquery-1.8.3.min.js"></script>
	<script src="jgp/js/pbd.js"></script>
	<script src="jgp/js/iBox.js"></script>
	<script src="js/talkingdata.js"></script>
</head>
<body id="body" class="um-vp  ub-ver " >
	<div  class="ub ub-ver " id="div1">
		</div>
		<div class=" uinn " id="cont1">
	</div>
	<div id="diyLoadDiv" class="uhide"></div>
</body>
<script>
zy_init();
window.uexOnload=function(type){
	if(!type){
//		loadingStart("加载中...", 0);
//        $.iBoxWait();
		intConter();
		IC.talkingDataCount("机供品","0005");
//		 $("#cont1").height($$("body").offsetHeight);
//		uexWindow.setBounce("1");
//		uexWindow.showBounceView("0", "rgba(255,255,255,0)", "0");
//        uexWindow.showBounceView("1", "rgba(255,255,255,0)", "0");
	}
}
	/****************更改提交进行数据统计**************/
	function updateDate1(idCode){
//		alert(idCode);
IC.talkingDataCount("机供品","0005");
		var tdcarray = JSON.parse(getStorage("RecycleArry"));
		var id=null;
		for (var i = 0; i < tdcarray.length; i++) {
			var F_WZID = tdcarray[i].F_WZID;
			var F_RKSL = tdcarray[i].F_RKSL;
			$("#cont1 input").each(function(){
				 id = $(this).attr("id");
				if (id.indexOf("yin") < 0) {
					if (id == F_WZID) {
						if (F_RKSL != $(this).val()) {
							tdcarray[i].F_RKSL=$(this).val();
						}
					}
				}
			});
		}
		var zbid =tdcarray[0].F_ZBID;
		var flightNo = getStorage("HBH");
		flightNo=flightNo.replace(/[^0-9]/ig, "");
		var flightDate =getStorage("dateTime");
	    updateRecycle(JSON.stringify(tdcarray),zbid);//修改数据库
	    selectRecycleLoad(zbid,flightNo,flightDate,function(str){
			var mycars=['确认', '取消'];
			uexWindow.confirm("提交提示","是否确认提交？",mycars);
			uexWindow.cbConfirm = function confirmCallback(opId, dataType, data){
		    if(data==1){  
					return;
			}else{
				var CWCode; 
				if(idCode==0){//直接提交
					CWCode='';
				}else{//扫码交接
				alert("扫码");
					CWCode=JSON.parse(idCode);
				}
		var param  = {"SuppliesXML":str,"F_MEMO":"","CWCode":CWCode,"F_PBDBH":zbid,"F_RKBH":getStorage("F_RKBH"),"UserID":getStorage("userId"),"F_KFID":getStorage("kfid"),
		               "F_HBC":flightNo,"F_HBRQ":flightDate,"F_HDBH":getStorage("F_HDBH"),"F_FJJH":getStorage("F_FJJH")};
//		loadingStart("加载中...", 0);
        $.iBoxWait();
		$.ajax({
        url : updateHsUrl,
        type : "post",
		data : param,
        dataType:"json", 
        success: function(data){
				 if (data.status==0) {
				 	 $.iBoxMsg("提交成功");
//					    loadingStart("提交成功",2000);
						var hsZbid = data.array;
					    updateRecycleId(hsZbid,zbid);
						intConter();
					}else if(data.status==1){
						var mycars = ['确认', '取消'];
							uexWindow.confirm("提交失败提示", "是否再次提交？", mycars);
							uexWindow.cbConfirm = function confirmCallback(opId, dataType, data1){
								if (data1 == 0) {
									updateDate1();
								}
							};
						$.iBoxHide();
//						loadingEnd();
//						uexWindow.alert("提示消息", "操作失败请重试", "确定");
					}else{
						 $.iBoxMsg("网络异常，请重试");
//						loadingEnd();
//						 uexWindow.alert("提示消息", "网络异常，请重试", "确定");
					}
		       },
			   error: function(data){
			   	    $.iBoxMsg("网络异常，数据已经保存至本地，请稍后提交！");
//			   	   loadingStart("网络异常，数据已经保存至本地，请稍后提交！", 3000);
			   }
			})
		 }  
	 };
		})
		//公务舱修改
		
	
} 
</script>
</html>
